import { Button, Form, Input, Modal } from 'antd';
import { useEffect } from 'react';

/*
 * @Description:在线恢复详情
 * @Author: Zzt
 * @Date: 2022-08-18 15:27:08
 * @LastEditTime: 2022-08-18 16:46:01
 */
const Online = (props: any) => {
  const { visible, data, onClose } = props;
  const [form] = Form.useForm();
  data.recoveryType = '在线恢复';
  useEffect(() => {
    form.setFieldsValue(data);
  }, [visible]);
  const submitFunc = () => {
    form.submit();
    onClose();
  };
  const handleCancel = () => {
    onClose();
  };
  return (
    <>
      <Modal
        visible={visible}
        title="恢复数据详情"
        // onOk={handleOk}
        onCancel={handleCancel}
        width={700}
        footer={[
          <Button
            key="yes"
            type="primary"
            onClick={() => {
              submitFunc();
            }}
          >
            终止备份
          </Button>,
          <Button key="close" onClick={onClose}>
            取消
          </Button>
          // <Button key="createAdd" type="primary">创建并添加档案</Button>,
        ]}
      >
        <Form form={form} size="small">
          <Form.Item label="档案类型" name="archivesType">
            <Input bordered={false} disabled={true}></Input>
          </Form.Item>
          <Form.Item label="恢复到库" name="recoveryScope">
            <Input bordered={false} disabled={true}></Input>
          </Form.Item>
          <Form.Item label="恢复类型" name="recoveryType">
            <Input bordered={false} disabled={true}></Input>
          </Form.Item>
          <Form.Item label="计划名称" name="planName">
            <Input bordered={false} disabled={true}></Input>
          </Form.Item>
          <Form.Item label="恢复节点" name="backupNode">
            <Input bordered={false} disabled={true}></Input>
          </Form.Item>
          <Form.Item label="恢复方式" name="recoveryMethod">
            <Input bordered={false} disabled={true}></Input>
          </Form.Item>
          <Form.Item label="数据恢复状态" name="state">
            <Input bordered={false} disabled={true}></Input>
          </Form.Item>
          <Form.Item label="恢复开始时间" name="startTime">
            <Input bordered={false} disabled={true}></Input>
          </Form.Item>
          <Form.Item label="恢复完成时间" name="finishTime">
            <Input bordered={false} disabled={true}></Input>
          </Form.Item>
          <Form.Item label="处理人" name="Handler">
            <Input bordered={false} disabled={true}></Input>
          </Form.Item>
          <Form.Item label="恢复备注" name="remake">
            <Input bordered={false} disabled={true}></Input>
          </Form.Item>
        </Form>
      </Modal>
    </>
  );
};
export default Online;
